package com.zhdl.modules.common.service.impl;

import com.zhdl.modules.assemblybolt.AssemblyBoltProcess;
import com.zhdl.modules.common.service.CommonService;
import com.zhdl.modules.conveyerbelt.service.ConveyerBeltService;
import com.zhdl.modules.demo.web.DemoProcess;
import com.zhdl.modules.puncturecable.web.PunctureCableProcess;
import com.zhdl.modules.wallpulley.web.WallPulleyProcess;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Slf4j
@Service
public class CommonServiceImpl implements CommonService {

    /**
     * 流程ID
     */
    private int processId = 0;

    @Resource
    private WallPulleyProcess wallPulleyProcess;

    @Resource
    private ConveyerBeltService conveyerBeltService;

    @Resource
    private AssemblyBoltProcess assemblyBoltProcess;

    @Resource
    private PunctureCableProcess punctureCableProcess;

    @Resource
    private DemoProcess demoProcess;
    /**
     * 流程初始化
     */
    @Override
    public void processInit(){
        if (processId == 0){
            wallPulleyProcess.init();
//            wallPulleyProcess.initTest();
        } else if (processId == 1){
            conveyerBeltService.initMaps();
        } else if (processId == 2){
            assemblyBoltProcess.initPort();
        } else if (processId == 3){
            punctureCableProcess.init();
        } else if (processId == 4){
            demoProcess.init();
        }
    }
}
